﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace BlogWeb.Models
{
    public class ChangePwdView
    {
        [DisplayName("原始密码")]
        [Required]
        [RegularExpression(@"^[a-zA-Z0-9]{6,}$", ErrorMessage = "至少6位字母加数字密码")]
        public string OldPwd { get; set; }
        [DisplayName("新密码")]
        [Required]
        [RegularExpression(@"^[a-zA-Z0-9]{6,}$", ErrorMessage = "至少6位字母加数字密码")]
        public string NewPwd { get; set; }
        [DisplayName("确认新密码")]
        [Required]
        [RegularExpression(@"^[a-zA-Z0-9]{6,}$", ErrorMessage = "至少6位字母加数字密码")]
        [Compare("NewPwd",ErrorMessage = "两次密码不一致")]
        public string ChkPwd { get; set; }
    }
}